/*
 * --------------------------------------------------------------
 * Copyright ©  2015 Hangzhou DtDream Technologies Co.,Ltd.
 * --------------------------------------------------------------
 *      Product: 协同数治
 *  Module Name: design
 * Date Created: 2023/2/21
 *  Description: TODO
 * --------------------------------------------------------------
 * Modification History
 * DATE            NAME            Description
 * --------------------------------------------------------------
 * 2023/2/21       yewj            TODO
 * --------------------------------------------------------------
 */

package com.dtdream.pattern.flyweight;

import java.util.HashMap;

/**
 * TODO
 *
 * @Author: yewj
 **/
public class WebSiteFactory {

    private HashMap<String, ConcreteWebSite> pool = new HashMap<>(16);

    public WebSite getWebSiteCategory(String type) {
        if (!pool.containsKey(type)) {
            pool.put(type, new ConcreteWebSite(type));
        }
        return pool.get(type);
    }

    public int getWebSiteCount() {
        return pool.size();
    }

}
